#include <time.h>
#include "manager.h"
#include "explosionFactory.h"

Gamedata* Gamedata::instance;
SpriteFrameFactory* SpriteFrameFactory::instance = NULL;
MultiSpriteFrameFactory* MultiSpriteFrameFactory::instance = NULL;
ExplosionFrameFactory* ExplosionFrameFactory::instance = NULL;

int main(int, char*[]) {
	try {
		srand( time(NULL) );
		bool done;
		Manager *game_manager = new Manager();
		while(not done)
		{
			game_manager->play();
			if(game_manager->getRestart())
			{
				delete game_manager;
				game_manager = new Manager();
			}
			else
			 done = true;
		}
		delete game_manager;
	}
	catch (const string& msg) { std::cout << msg << std::endl; }
	catch (...) {
		std::cout << "Oops, someone threw an exception!" << std::endl;
	}
	return 0;
}
